package com.yunfeng.supercall.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 基础类
 * @author 洋
 *
 */
public class BeanBase implements Parcelable {

	public BeanBase(Parcel parcel) {
		lat = parcel.readDouble();
		lng = parcel.readDouble();
		userid = parcel.readInt();
		content = parcel.readString();
		nick_name = parcel.readString();
		photo = parcel.readString();
		createtime = parcel.readString();
	}

	public BeanBase() {

	}

	private double lat;
	private double lng;
	private int userid;
	private String content;
	private String nick_name;
	private String photo;
	private String createtime;

	public String getCreatetime() {
		return createtime;
	}

	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}

	public String getNick_name() {
		return nick_name;
	}

	public void setNick_name(String nick_name) {
		this.nick_name = nick_name;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getUserid() {
		return userid;
	}

	public void setUserid(int userid) {
		this.userid = userid;
	}

	public double getLat() {
		return lat;
	}

	public void setLat(double lat) {
		this.lat = lat;
	}

	public double getLng() {
		return lng;
	}

	public void setLng(double lng) {
		this.lng = lng;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	public static final Parcelable.Creator<BeanBase> CREATOR = new Creator<BeanBase>() {

		@Override
		public BeanBase createFromParcel(Parcel source) {
			BeanBase mBeanBase = new BeanBase();
			mBeanBase.lat = source.readDouble();
			mBeanBase.lng = source.readDouble();
			mBeanBase.userid = source.readInt();
			mBeanBase.content = source.readString();
			if(mBeanBase.content == null) mBeanBase.content = "";
			mBeanBase.nick_name = source.readString();
			if(mBeanBase.nick_name == null) mBeanBase.nick_name = "";
			mBeanBase.photo = source.readString();
			if(mBeanBase.photo == null) mBeanBase.photo = "";
			mBeanBase.createtime = source.readString();
			if(mBeanBase.createtime == null) mBeanBase.createtime = "";
			return mBeanBase;
		}

		@Override
		public BeanBase[] newArray(int size) {
			// TODO Auto-generated method stub
			return  new BeanBase[size];
		}
	};
	
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeDouble(lat);
		dest.writeDouble(lng);
		dest.writeInt(userid);
		dest.writeString(content);
		dest.writeString(nick_name);
		dest.writeString(photo);
		dest.writeString(createtime);
	}

}
